<template>
  <div class="box section clearfix">
    <el-form :inline="true" style="text-align: left" ref="query" :model="query">
      <el-row class="query">
        <el-form-item label="姓名：" prop="jkrName">
          <el-input
            placeholder="请输入借款人姓名"
            v-model="query.jkrName"
          ></el-input>
        </el-form-item>
        <el-form-item label="身份证号：" prop="jkrCar">
          <el-input
            placeholder="请输入借款人身份证号"
            v-model="query.jkrCar"
          ></el-input>
        </el-form-item>
        <el-form-item class="btn">
          <el-button type="danger" @click="clearFun" v-no-more-click
            >清空</el-button
          >
          <el-button type="primary" @click="queryFun" v-no-more-click
            >搜索</el-button
          >
        </el-form-item>
      </el-row>
    </el-form>
    <el-table :data="tableData" border stripe style="width: 100%">
      <el-table-column
        prop="jkrName"
        label="借款人姓名"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="jkrCar"
        label="借款人身份证"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="jkrComp"
        label="合作单位"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="bailMoney"
        label="担保审批金额"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="bailTime"
        label="担保审批期限"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="actualMoney"
        label="实际审批金额"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="actualTime"
        label="实际审批期限"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="isStat"
        label="当前步骤"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="acceptTime"
        label="受理时间"
        align="center"
        :show-overflow-tooltip="true"
      />
    </el-table>
    <!--分页控件-->
    <div class="pagination">
      <span class="title">小计：共{{ this.total }}条数据</span>
      <el-pagination
        background
        layout="total,prev, pager, next, sizes"
        :total="total"
        :page-size="query.pageSize"
        :current-page.sync="currentPage"
        :page-sizes="[10, 20, 30, 40]"
        @current-change="handleCurrentChange"
        @size-change="handleSizeChange"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
import { getXhphPage } from "../../../src/assets/js/api";

export default {
  name: "RealEstate",
  data() {
    return {
      query: {
        pageSize: 10,
        pageNo: 1,
        jkrCar: "",
        jkrName: "",
      },
      tableData: [],
      total: 10,
      pages: 0,
      currentPage: 1,
    };
  },
  created() {
    this.getList();
  },
  methods: {
    //   获取数据
    getList() {
      getXhphPage(this.query).then((res) => {
        if (res.code == 200) {
          this.tableData = res.data.records;
          this.currentPage = res.data.current;
          this.total = res.data.total;
          this.pages = res.data.pages;
        }
      });
    },
    // 清空
    clearFun() {
      this.$refs["query"].resetFields();
      this.query.pageNo = 1;
      this.getList();
    },
    // 搜索
    queryFun() {
      this.getList();
    },
    //分页
    handleCurrentChange(cpage) {
      this.query.pageNo = cpage;
      this.getList();
    },
    handleSizeChange(psize) {
      this.query.pageNo = 1;
      this.query.pageSize = psize;
      this.getList();
    },
  },
};
</script>

<style scoped type="less">
::v-deep .el-table td
{
    padding: 10px 0;
}
::v-deep .el-table th
{
    padding: 10px 0;
}
.query ::v-deep .el-input__inner
{
    height: 32px;
}
.query ::v-deep .el-input__icon
{
    line-height: 32px;
}
.query ::v-deep .el-form-item
{
    width: 320px;
}
.query ::v-deep .vue-treeselect__control
{
    line-height: 30px;  height: 32px;
}
.query ::v-deep .vue-treeselect__single-value,
.query ::v-deep .vue-treeselect__placeholder
{
    line-height: 30px;
}
::v-deep .btn .el-button
{ line-height: 0;

    width: 80px;  height: 32px; 
}
::v-deep .el-table th > .cell
{ font-size: 14px;
    font-weight: bold;  color: #333; 
}
::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td
{
    background: rgba(59, 157, 248, .1);
}
.box
{
    position: relative;  padding: 20px 20px 50px 20px;
 background: #fff; 
}
::v-deep .el-pagination
{
    position: absolute;  right: 0;
 margin-top: 20px; 
}
::v-deep .el-pagination__total
{
    visibility: hidden;
}
.title
{ font-family: Microsoft YaHei;  font-size: 12px;  font-weight: 400;  line-height: 21px;

    position: absolute;  left: 0;  margin-top: 15px;  color: rgba(51, 51, 51, 1); 
}

</style>
